Skip to content

Conversation

@albertomercurio
Copy link
Member

Checklist

Thank you for contributing to QuantumToolbox.jl! Please make sure you have finished the following tasks before opening the PR.

  • Please read Contributing to Quantum Toolbox in Julia.
  • Any code changes were done in a way that does not break public API.
  • Appropriate tests were added and tested locally by running: make test.
  • Any code changes should be julia formatted by running: make format.
  • All documents (in docs/ folder) related to code changes were updated and able to build locally by running: make docs.
  • (If necessary) the CHANGELOG.md should be updated (regarding to the code changes) and built by running: make changelog.

Request for a review after you have completed all the tasks. If you have not finished them all, you can also open a Draft Pull Request to let the others know this on-going work.

Description

I added an additional callback to the ssesolve function to always keep the state normalized. This significantly improves the stability of the stochastic solver.

I have also changed the generation of the integer initial state in the tests, as it was a non-physical one and it was giving unstable results for the solver.

Related issues or PRs

Fixes #382

@codecov
Copy link

codecov bot commented Feb 2, 2025

Codecov Report

Attention: Patch coverage is 96.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 93.42%. Comparing base (b63c19b) to head (bfea504).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...tion/callback_helpers/ssesolve_callback_helpers.jl 88.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #383      +/-   ##
==========================================
+ Coverage   93.41%   93.42%   +0.01%     
==========================================
  Files          43       44       +1     
  Lines        2809     2829      +20     
==========================================
+ Hits         2624     2643      +19     
- Misses        185      186       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@ytdHuang ytdHuang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@albertomercurio albertomercurio merged commit 8cbd549 into qutip:main Feb 2, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong output when using ssesolve solver

2 participants